home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / lite411q.zip / LDEMO3.BAS < prev    next >
BASIC Source File  |  1991-07-25  |  5KB  |  147 lines

  1. '============================================================================
  2. '
  3. '                        LDEMO3.BAS - Window Demo #3
  4. '                         ProWindows(tm) LITE 4.00
  5. '              (c) Copyright 1988-1991 DSE Software Publishing
  6. '
  7. '==========================================================================
  8. '
  9. '    To make use of this demonstration program, you must use the library
  10. '    created with MOUSE.BAT and then you must load BASIC EXACTLY as
  11. '    follows:
  12. '
  13. '         QB LDEMO3 /AH /L LITEDEMO               (for QuickBASIC)
  14. '         QBX LDEMO3 /AH /EA /L LITEDEMO          (for BASIC PDS 7)
  15. '
  16. '==========================================================================
  17.  
  18. REM $DYNAMIC
  19. DEFINT A-Z
  20.  
  21. ' =======================================================================
  22. ' Additional INCLUDE modules should follow
  23. ' =======================================================================
  24.  
  25. REM $INCLUDE: 'LITE.bi'
  26.  
  27. CLEAR , , 4096                     ' Set aside additional stack space
  28.  
  29. ' =======================================================================
  30. ' These constants should be defined in ALL applications.
  31. ' =======================================================================
  32.  
  33. CONST WINMEMSIZE% = 8191           ' Window memory, used by 'VirMem%()'
  34. CONST SCRNMEMSIZE% = 4096          ' Screen storage memory, used by 'scrn%()'
  35. CONST MAXWINDOWS% = 30             ' maximum number of windows
  36.  
  37. ' =======================================================================
  38. ' This must be INCLUDE'ed after the CONSTants are defined
  39. ' =======================================================================
  40.  
  41. DIM SHARED VirMem(WINMEMSIZE) AS INTEGER
  42. DIM SHARED scrn(SCRNMEMSIZE) AS INTEGER
  43. DIM SHARED vcb(MAXWINDOWS) AS vircb
  44. DIM SHARED wcb(MAXWINDOWS) AS wincb
  45. DIM SHARED wcbndx(MAXWINDOWS) AS INTEGER
  46.  
  47. ' =======================================================================
  48. ' Program initialization code
  49. ' =======================================================================
  50.  
  51.     ReCycleMode 1                           ' enable "Video Recycling" saves 24K
  52.  
  53.     InitPro                                 ' initialize ProWindows
  54.  
  55.     MouseInstalled = CheckMouse(buttons)    ' install the mouse driver
  56.     MouseCursorOn
  57.     MouseCursorOn
  58.     
  59. ' =======================================================================
  60. ' Your code goes here
  61. ' =======================================================================
  62.  
  63. ' =======================================================================
  64. ' Remove next two "REM" statements for simulated monochrome mode
  65. ' =======================================================================
  66.  
  67.     REM SetBWmode ENABLE
  68.     REM SetMonitorColor 6   '1 is blue, 2 is green, 6 is amber, etc...
  69.  
  70.     FillScreen 1, 1, 25, 80, attr(0, 1), 176, SNOW
  71.     FillScreen 25, 1, 1, 23, 79, 32, SNOW
  72.  
  73. MainMenu:
  74.     
  75.     QuickKey 1, CHR$(0) + CHR$(60)     ' F2
  76.     QuickKey 2, CHR$(0) + CHR$(61)     ' F3
  77.     QuickKey 3, CHR$(0) + CHR$(62)     ' F4
  78.     QuickKey 4, CHR$(0) + CHR$(45)     ' Alt-X
  79.  
  80.     SetCalendar 0, 25, 2, 79, 1
  81.     SetClock 0, 25, 15, 79, 1
  82.     
  83.     GlobalOptions = SELECTABLE + DRAGBAR + OFFBUTTON + AUTOCLOSE + RESIZEBUTTON
  84.  
  85.     Notice
  86.     
  87.     OpenWindow 1, 15, 37, attr(0, 7), 1, 1, 1, GlobalOptions
  88.     OpenWindow 2, 15, 37, attr(7, 1), 1, 1, 1, GlobalOptions
  89.     OpenWindow 3, 15, 37, attr(15, 4), 1, 1, 1, GlobalOptions
  90.     OpenWindow 4, 15, 37, attr(15, 2), 1, 1, 1, GlobalOptions
  91.     OpenWindow 5, 15, 37, attr(15, 5), 1, 1, 1, GlobalOptions
  92.  
  93.     FOR x = 1 TO 5
  94.         setWindow x
  95.         wcprint 6, "Maipulate me with a mouse!"
  96.         cwcprint 7, 30, "ALT-X to Quit"
  97.         titleWindow 4, " Window" + STR$(x) + " "
  98.     NEXT
  99.  
  100.     DisplayWindow 1, 2, 10, 15, 37
  101.     DisplayWindow 2, 4, 15, 15, 37
  102.     DisplayWindow 3, 6, 20, 15, 37
  103.     DisplayWindow 4, 8, 25, 15, 37
  104.     DisplayWindow 5, 10, 30, 15, 37
  105.     
  106.     DO
  107.         
  108.         SELECT CASE GetEvent(0)
  109.             CASE 15, 16
  110.                 GOTO quitProg
  111.             CASE 16                  ' <ESC> was pressed
  112.                 END
  113.             CASE 19
  114.                 GOSUB QuickKeyEvent
  115.             CASE ELSE
  116.  
  117.         END SELECT
  118.  
  119.     LOOP
  120.  
  121.  
  122. QuickKeyEvent:
  123.  
  124.     QuickEventNo = GetEvent(19)
  125.  
  126.     SELECT CASE QuickEventNo
  127.         CASE 1, 2, 3
  128.             PopWindow 0, 0, 5, 40, 112, 1, 1, 1
  129.             wcprint 2, "You pressed Quick Key #" + STR$(QuickEventNo)
  130.             SLEEP 1
  131.             RemoveWindow
  132.         CASE 4
  133. quitProg:               FOR x = 5 TO 1 STEP -1
  134.                 CloseWindow x
  135.             NEXT
  136.                     MouseCursorOff
  137.             CLS
  138.             PRINT "Thanks for running me!"
  139.             END
  140.  
  141.         CASE ELSE
  142.  
  143.     END SELECT
  144.  
  145.     RETURN
  146.  
  147.